package com.net.dao;

import java.util.List;

import com.net.model.Commodity;
import com.net.model.User;

public interface CommodityDao {
	public void save(Commodity u);
	public void update(Commodity commodity);
	public boolean delete(Commodity u);
	public List<Commodity> getCommodities();
	public Commodity loadCommodityById(int id);
	public List<Commodity> searchList(Commodity commodity);
	public int getCount();
	public Commodity loadCommodityByName(String name);
	/**
	 * 查询列表
	 * @param currentPage当前页数
	 * @param perPage每页记录数
	 * @param orderType排序方式 dec或者asc
	 * @param orderName
	 * @return
	 */
	public List<Commodity> getCommodities(final int currentPage,final int perPage,final String orderType,final String orderName);
	/**
	 * 条件查询列表
	 * @param currentPage
	 * @param perPage
	 * @param condition查询条件
	 * @return
	 */
	public List<Commodity> getCommoditiesByCondition(final int currentPage,final int perPage,final String condition);
}
